#include "JetsonEncApi.h"
#include "JetsonEnc.h"

#include "JetsonDec.h"

 JetsonEncAPI* JetsonEncAPI::CreateJetsonEnc(int width, int height, int video_fps)
 {
	 
	 return	 new JetsonEnc(width, height, video_fps);
	 
 }
 
  JetsonDecAPI* JetsonDecAPI::CreateJetsonDec(uint32_t decoder_pixfmt, int width , int height , unsigned char *buffer )
 {
	 
	 return	 new JetsonDec(decoder_pixfmt, width,height,buffer);
	 
 }
   JetsonDecAPI* JetsonDecAPI::CreateJetsonDec(std::string decoder_pixfmt, int width , int height , unsigned char *buffer )
 {
	 
	 if(decoder_pixfmt =="H265" || decoder_pixfmt =="h265" || decoder_pixfmt =="hevc"|| decoder_pixfmt =="HEVC")
	 return	 new JetsonDec(V4L2_PIX_FMT_H265, width,height,buffer);
	 	 if(decoder_pixfmt =="H265" || decoder_pixfmt =="h265" || decoder_pixfmt =="hevc"|| decoder_pixfmt =="HEVC")
	 return	 new JetsonDec(V4L2_PIX_FMT_H264, width,height,buffer);
 }